xen: add support for automatic debug key actions in case of crash
authorJuergen Gross <jgross@suse.com>
Sat, 16 Jan 2021 10:33:39 +0000 (11:33 +0100)
committerJulien Grall <jgrall@amazon.com>
Sat, 23 Jan 2021 11:31:32 +0000 (11:31 +0000)
commit7a02176b13f31185dd37323d61814ca3e54a80d6
treeccdd8acb96455be5b05c4402723e04683b936967
parenta4e8b178bfb4ee404cc7329032112d0c18ca4b66
xen: add support for automatic debug key actions in case of crash

When the host crashes it would sometimes be nice to have additional
debug data available which could be produced via debug keys, but
halting the server for manual intervention might be impossible due to
the need to reboot/kexec rather sooner than later.

Add support for automatic debug key actions in case of crashes which
can be activated via boot- or runtime-parameter.

Depending on the type of crash the desired data might be different, so
support different settings for the possible types of crashes.

The parameter is "crash-debug" with the following syntax:

  crash-debug-<type>=<string>

with <type> being one of:

  panic, hwdom, watchdog, kexeccmd, debugkey

and <string> a sequence of debug key characters with '+' having the
special semantics of a 10 millisecond pause.

So "crash-debug-watchdog=0+0qr" would result in special output in case
of watchdog triggered crash (dom0 state, 10 ms pause, dom0 state,
domain info, run queues).

Don't call key handlers in early boot, as some (e.g. for 'd') require
some initializations to be finished, like scheduler or idle domain.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
docs/misc/xen-command-line.pandoc
xen/common/kexec.c
xen/common/keyhandler.c
xen/common/shutdown.c
xen/drivers/char/console.c
xen/include/xen/kexec.h
xen/include/xen/keyhandler.h